package com.itic.codeGen.codeGenerator.workLine;

import java.util.List;
import java.util.Map;

import com.itic.codeGen.codeGenerator.util.CommonUtils;
import com.itic.codeGen.codeGenerator.util.CommonUtils.FILE_TYPE;

public class TargetJava {
    String pkage;
    String project;
    String clzName;
    String superClz;
    List<String> imports;
    List<String> implClzs;
    List<String> header;
    List<String> body;

    public TargetJava(Map<String, Object> params) {
	pkage = null == params.get("package") ? null : params.get("package")
	        + "";
	project = null == params.get("project") ? null : params.get("project")
	        + "";
    }

    @SuppressWarnings("unchecked")
    public void setFileType(Map<String, Object> params, FILE_TYPE ft) {
	this.setSuperClz(null == params.get("base" + ft.getType()) ? null
	        : params.get("base" + ft.getType()) + "");
	this.setPkage(CommonUtils.packageFomatter(
	        null == params.get("package") ? null : params.get("package")
	                + "", ft));
	this.setClzName(null == params.get("domain") ? null : params
	        .get("domain") + "" + ft.getType());
	this.setImplClzs((List<String>) params.get(ft.getType() + "implements"));
	this.setImports((List<String>) params.get(ft.getType() + "imports"));
	this.setHeader((List<String>) params.get(ft.getType() + "header"));
	this.setBody((List<String>) params.get(ft.getType() + "body"));
    }

    public String getPkage() {
	return pkage;
    }

    public void setPkage(String pkage) {
	this.pkage = pkage;
    }

    public String getProject() {
	return project;
    }

    public void setProject(String project) {
	this.project = project;
    }

    public String getClzName() {
	return clzName;
    }

    public void setClzName(String clzName) {
	this.clzName = clzName;
    }

    public String getSuperClz() {
	return superClz;
    }

    public void setSuperClz(String superClz) {
	this.superClz = superClz;
    }

    public List<String> getImports() {
	return imports;
    }

    public void setImports(List<String> imports) {
	this.imports = imports;
    }

    public List<String> getImplClzs() {
	return implClzs;
    }

    public void setImplClzs(List<String> implClzs) {
	this.implClzs = implClzs;
    }

    public List<String> getHeader() {
	return header;
    }

    public void setHeader(List<String> header) {
	this.header = header;
    }

    public List<String> getBody() {
	return body;
    }

    public void setBody(List<String> body) {
	this.body = body;
    }

}
